package com.lm.auth.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * 认证接口
 *
 * @author lm
 * @date
 */
@Api(tags = "认证接口")
@RestController
@RequestMapping("/token")
public class AuthController {

    @ApiOperation("获取当前用户信息")
    @GetMapping("/current")
    @ResponseBody
    public Principal getUser(Principal principal) {
        return principal;
    }

}
